package Scuttlebutt;

import java.awt.event.*;
import javax.swing.*;

public class EventExit extends JMenuItem implements ActionListener 
{
	Scuttlebutt parent = null;
	public EventExit(String text, Scuttlebutt parent)
	{
		super(text);
		this.parent = parent;
		addActionListener(this);
	}
	
	public void actionPerformed(ActionEvent a0)
	{
		parent.getEditPane().SaveAllTabs();
		parent.getSettings().setWindowState(parent.getExtendedState());
		parent.getSettings().setDivider(parent.getPanels().getTopDivider());
		parent.getSettings().setLowerDivider(parent.getPanels().getBottomDivider());
		
		parent.getSettings().saveSettings(parent.getSettings());
		parent.saveProject();
		
		
		
		System.exit(0);
	}
}

